<template>
	<div id="centreRight1">
		<div class="bg-color-black">

			<span style="color:#5cd9e8">
				<svg-icon icon-class="alalist"></svg-icon>
			</span>
			<span class="fs-xl text mx-2">堆垛机报警信息</span>
		</div>
		<div class="d-flex">
			<dv-scroll-board :config="config" style="box-sizing:border-box;height:90%;width:95% " />
		</div>
	</div>
</template>

<script>
	import api from '@/http/api'
	import {
		deepCopy,
		formatDate,
		formatSeconds
	} from "@/utils/index";
	export default {
		data() {
			return {
				itemList: [],
				config: {
					header: ["计划单号", "物料编码", "物料名称", "数量"],
					data: [

					],
					rowNum: 5, //表格行数

					headerBGC: "transparent", //表头
					oddRowBGC: "transparent", //奇数行
					evenRowBGC: "transparent", //偶数行
					align: ["left"],
					columnWidth: [60],
					index: true,
					indexHeader:'行号'
				}
			};
		},
		components: {},
		mounted() {
		//	this.fetchData();


		},
		methods: {
			fetchData() {
				this.config.data = [];
				this.$http.get('/API/getDDJStatus', ).then((response) => {
					if (response.data.code == 0) {
						let map = response.data.data;
						
						let  data11 = map.map(( item )=>{
							let ar =[];
							ar.push(Object.keys(item)[0]) ;
							ar.push(Object.values(item)[0]) ; 
							return ar;
						})
						
						this.config.data = data11;


						this.config = {
							...this.config
						}

						setTimeout(this.fetchData, 10000);
					}


				})

			},
		}
	};
</script>

<style lang="scss">
	#centreRight1 {
		display: flex;
		flex-direction: column;
		align-items: center;
		height: 100%;
		width: 100%;

		.bg-color-black {
			height: 10%;
			padding-top: 25px;
		}

		.d-flex {
			width: 95%;
			flex: 2;
			padding: 0 20px 0 20px;

		}

		.dv-scroll-board .header {
			height: 30px;
		}


	}
</style>
